package com.sudu.tool.impl;

import com.sudu.tool.MD5;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;


@Component
public class MD5Impl implements MD5 {
    @Override
    public String getMD5Password(String password, String salt) {
        for(int i = 0 ; i < 3 ; i++) {
            password =   DigestUtils.md5DigestAsHex((salt + password + salt).getBytes()).toUpperCase() ;
        }

        return password ;
    }
}
